import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/about',
    children: [
      {
        path: 'about',
        name: 'About',
        component: () => import('../views/About.vue')
      },
      {
        path: 'user',
        name: 'User',
        component: () => import('../views/user/User')
      },
      {
        path: 'goods',
        name: 'Goods',
        component: () => import('../views/goods/Goods')
      },
      {
        path: 'prospec',
        name: 'Prospec',
        component: () => import('../views/prospec/prospec')
      },
      {
        path: 'shop',
        name: 'Shop',
        component: () => import('../views/shop/Shop')
      },
      {
        path: 'sales',
        name: 'Sales',
        component: () => import('../views/sales/Sales')
      },
      {
        path: 'loss',
        name: 'Loss',
        component: () => import('../views/loss/Loss')
      },
      {
        path: 'cabinet',
        name: 'Cabinet',
        component: () => import('../views/cabinet/Cabinet')
      },
      {
        path: 'type',
        name: 'Type',
        component: () => import('../views/Type/Type')
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login')
  }

]

const router = new VueRouter({
  routes
})

export default router
